package com.lanou.service;

import com.lanou.bean.AdminInfo;
import org.apache.ibatis.annotations.Param;

import java.util.InputMismatchException;
import java.util.List;

/**
 * Created by lanouhn on 17/10/18.
 */
public interface AdminService {

    AdminInfo selectAdmin(AdminInfo adminInfo);

    List<Integer> selectRoleIdById(Integer admin_id);

    String selectroleNameById(Integer cost_id);
    //    管理员信息查询
    List<AdminInfo> selectAllAdmin();


//    向admin——info插入数据
    int insertAdmin(String admin_code,String name,String password,String telephone,String email);
//      根据admin_code获取id
    int selectIdByname(String admin_code);
//      根据名字获取role_id
    int getId(String name);
//    向中间表插入数据
    int insertAdminRole(Integer admin_id,Integer role_id);
//      查询所有的角色信息
    List<String> selectRoleList();



//    删除管理员信息
    int deleteAdmin(Integer admin_id);

    List<Integer> getRoleId(Integer admin_id);

    int deleteByRoelId(Integer role_id);

    int deleteAdminroleInfo(Integer admin_id);


//    管理员信息回显
    AdminInfo selectAdminInfoById(Integer admin_id);

    int updateAdminInfoById(Integer admin_id,String admin_code,String name,String telephone,String email);


    int updateSave(@Param("admin_id") Integer admin_id, @Param("name")String name, @Param("telephone")String telephone, @Param("email")String email);

    List<Integer> selectAdminId();

    int updatepassword(Integer admin_id,String password);
}



